<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>支付页面</title>
    <script type="text/javascript" src="/js/jquery-3.5.1.min.js"></script>
</head>
<body>
<script>
    $(function(){
        var $span = $("#span_timer");
        timer(10,$span);
    });

    /**
     * 倒计时函数
     * @param num 倒计时秒数
     */
    var ft = null;
    function timer(num,$span){
        $span.html(num+"秒");
        ft = setInterval(function(){
            num--;
            if(num<1) {
                clearInterval(ft);
            }
            $span.html(num+"秒");
        },1000);
    }
</script>
<div>支付计时：<span id="span_timer">10</span></div>
订单：<span th:text="${order.orderNo}"></span><br/>
金额：<span th:text="${order.course.price}"></span><br>
<button><a th:href="@{'/order/payOrder?orderNo='+${order.orderNo}}">支付</a></button>
</body>
</html>